<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/4 0004
 * Time: 下午 10:02
 */

Route::group(['namespace' => 'User', 'middleware' => 'web', 'prefix' => '/'], function () {

    Route::post( 'login', 			        'UserController@login');
    Route::get(  'logout',                  'UserController@logOut');
    Route::get(  'autoLogin',               'UserController@autoLogin');
    //Route::post( 'getEmailCode', 	        'UserController@getEmailCode');

    Route::post( 'getRegisterPhoneCode',    'UserController@getRegisterPhoneCode');
    Route::post( 'registerByPhone',         'UserController@registerByPhone');
    Route::post( 'getResetPhoneCode',       'UserController@getResetPhoneCode');
    Route::post( 'resetByPhone',            'UserController@updatePasswordByPhone');

    Route::post( 'registerByEmail',         'UserController@registerByEmail');
    Route::post( 'getResetEmail', 	        'UserController@getResetEmail');
    Route::get(  'reset', 	                'UserController@passwordReset');
    Route::post( 'resetByEmail',	        'UserController@updatePasswordByEmail');

    Route::post( 'weiboCreate',             'UserController@weiboCreate');
    Route::post( 'weiboBind',               'UserController@weiboBind');
});

/*
 * 需要用户身份验证的接口
 */
Route::group(['namespace' => 'User', 'middleware' => 'user', 'prefix' => '/'], function () {
    Route::post( 'updatePassword',                  'InfoController@updatePaaword');
    Route::post( 'increaseStudyTime',               'InfoController@increaseStudyTime');
    Route::get(  'increaseLessonCount',             'InfoController@increaseLessonCount');
    Route::post( 'updateName',                      'InfoController@updateName');
    Route::post( 'updateHead',                      'InfoController@updateHead');
    Route::post( 'updateGrade',                     'InfoController@updateGrade');
    Route::post( 'updatePlayMod',                   'InfoController@updatePlayMod');
    Route::post( 'updatePlayTime',                  'InfoController@updatePlayTime');
    Route::post( 'updateSentenceMod',               'InfoController@updateSentenceMod');
    Route::post( 'updatePlan',                      'InfoController@updatePlan');
    Route::get(  'getUserRecord',                   'InfoController@getRecord');
    Route::any( 'increaseDaliyTime',               'InfoController@increaseDaliyTime');
    Route::any( 'increaseDaliyWord',               'InfoController@increaseDaliyWord');
    Route::get( 'getDaliyLog',                     'InfoController@getDaliyLog');

    Route::get(  'getUserAllLessons',               'LessonController@getUserAllLessons');
    Route::get(  'getUserLesson',                   'LessonController@getUserLesson');
    Route::post( 'addUserLesson',                   'LessonController@addLesson');
    Route::post( 'updateUserLesson',                'LessonController@updateLesson');
    Route::post( 'delUserLesson',                   'LessonController@delLesson');
    Route::get(  'getUserLessonDaily',              'LessonController@getUserLessonDaily');
    Route::get(  'getUserLessonWeek',               'LessonController@getUserLessonWeek');
    Route::get(  'getUserLessonMonth',              'LessonController@getUserLessonMonth');

    Route::get(  'getHardWords',                    'HardController@getHardWords');
    Route::post( 'addHardWord',                     'HardController@addHardWord');
    Route::post( 'addHardWords',                    'HardController@addHardWords');
    Route::post( 'delHardWord',                     'HardController@delHardWord');
    Route::post( 'delHardWords',                    'HardController@delHardWords');

    Route::get(  'getHardSentences',                'HardController@getHardSentences');
    Route::post( 'addHardSentence',                 'HardController@addHardSentence');
    Route::post( 'addHardSentences',                'HardController@addHardSentences');
    Route::post( 'delHardSentence',                 'HardController@delHardSentence');
    Route::post( 'delHardSentences',                'HardController@delHardSentences');

    Route::post( 'addRememberWords',                'RememberController@addRememberWords');
    Route::post( 'addRememberSentences',            'RememberController@addRememberSentences');
    Route::get(  'getUserAllRememberWords',         'RememberController@getUserAllRememberWords');
    Route::get(  'getUserAllRememberSentences',     'RememberController@getUserAllRememberSentences');
    Route::get(  'getUserRememberWordsWithPaging',  'RememberController@getUserRememberWordsWithPaging');
    Route::get(  'getUserRememberSentencesWithPaging', 'RememberController@getUserRememberSentencesWithPaging');

    Route::get(  'getTestWords',                    'WordController@getTestWords');

    Route::get(  'testPlay',                        'PlayController@testPlay');
});